#define _CRT_SECURE_NO_WARNINGS 1
#include"process.h"
#define NUM 103
#define Body '='
#define Head '>'
#include<string.h>

const char* lable = "|/-\\";

char buffer[NUM] = { 0 };
void process_flush(double rate)
{
	static int cnt = 0;
	int n = strlen(lable);
	if (rate <= 1.0)	buffer[0] = Head;
	printf("[\033[2;29;29m%-100s\033[0m][%.1lf%%][%c]\r", buffer, rate, lable[cnt]);
	fflush(stdout);
	buffer[(int)rate] = Body;
	if ((int)rate + 1 < 100)	buffer[(int)(rate+1)] = Head;
	if (rate >= 100.0)
		printf("\n");
	cnt++;
	cnt%= n;
}